package controllers

import (
	"fmt"

	//"project/g"
	"gitee.com/yesy/mdzs.git/models/item"
)

type ItemController struct {
	BaseController
}


func (this *ItemController) Default() {
	this.Layout = "layout/admin.html"
	this.TplName = "item/index.tpl"
}

// 列表
func (this *ItemController) GetItemList() {
	
	page, err := this.GetInt("page")
	if err != nil {
		return
	}
	
	//
	items := item.IdsInDB(page)
	if items == nil {
		fmt.Println("111111")
	} else {
		size := len(items)
		//ret := make([]int, size)
		for i := 0; i < size; i++ {
			//ret[i] = u[i].Id
			// fmt.Println("Name:", u)
			fmt.Println("Id:", items[i].Id)
			fmt.Println("AccId:", items[i].AccId)
		}
		this.Data["Items"] = items
	}
	
	this.Layout = "layout/admin.html"
	this.TplName = "item/index.html"
}